project(webleo)
cmake_minimum_required(VERSION 2.8)

add_definitions(-Wall -ggdb)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR})



  
add_executable(fetch fetch/main.c fetch/http.c lib/sockio.c)
add_executable(server-lite  lib/timeutil.c lib/sockio.c lib/server.c server-lite/main.c server-lite/client.c)
add_executable(server-threaded lib/pio.c  lib/timeutil.c lib/sockio.c lib/server.c server-threaded/main.c server-threaded/client.c lib/config.c)

target_link_libraries(server-lite rt)
target_link_libraries(server-threaded rt)

set_target_properties(server-threaded PROPERTIES COMPILE_DEFINITIONS "USE_THREADS=1")

install(TARGETS fetch server-lite server-threaded
        RUNTIME
        DESTINATION bin
)

add_subdirectory(configedit)


include_directories(${CMAKE_SOURCE_DIR})